package net.zjitc.android2019.ch2activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import net.zjitc.android2019.R;

public class Ch2Activity extends AppCompatActivity {
    Button btn1,btn2,btn3,btn4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ch2);
        btn1=findViewById(R.id.ch2_btn1);
        btn2=findViewById(R.id.ch2_btn2);
        btn3=findViewById(R.id.ch2_btn3);
        btn4=findViewById(R.id.ch2_btn4);
        View.OnClickListener clickListener=new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=null;
                switch (v.getId()){
                    case R.id.ch2_btn1:
                        intent=new Intent(Ch2Activity.this,RegisterActivity.class);
                        break;
                    case R.id.ch2_btn2:
                        intent=new Intent(Ch2Activity.this,BeautyActivity.class);
                        break;
                    case R.id.ch2_btn3:
                       intent=new Intent(Ch2Activity.this,BMIActivity.class);
                        break;
                    case R.id.ch2_btn4:
                       intent=new Intent(Ch2Activity.this,RegisterActivity.class);
                        break;
                }
                startActivity(intent);
            }
        };
        btn1.setOnClickListener(clickListener);
        btn2.setOnClickListener(clickListener);
        btn3.setOnClickListener(clickListener);
        btn4.setOnClickListener(clickListener);
    }
}
